package edu.nf.api.controller.shop;

import edu.nf.api.controller.BaseController;
import edu.nf.waimai.model.shop.Shop;
import edu.nf.waimai.service.shop.impl.ShopServiceImpl;
import org.nf.web.annotation.Model;
import org.nf.web.annotation.RequestMapping;
import org.nf.web.annotation.RequestParam;
import org.nf.web.servlet.View;
import org.nf.web.servlet.view.JsonView;


/**
 * @Date 2023-06-20
 * @Author qiu
 * 用户入住商家控制器
 */
public class RegisterShopController extends BaseController {

    /**
     * 商家注册
     * @param shop
     * @return
     */
    @RequestMapping("/shop/registerShop")
    public View registerShop(@Model Shop shop) {

        int row = new ShopServiceImpl().registerShop(shop);

        return row >= 1 ? new JsonView(success()) : new JsonView(error("no"));
    }

}
